inherited dm_clientecategoria: Tdm_clientecategoria
  OldCreateOrder = True
  Left = 427
  Top = 219
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '    c.cod_categoria,'
      '    c.descricao,'
      '    c.situacao,'
      '    c.data_cad,'
      '    c.data_alteracao,'
      '    case'
      '        when c.situacao = '#39'True'#39' then '#39'ATIVO'#39' else '#39'INATIVO'#39
      '    end as situacao_desc,'
      
        '    (select count(a.cod_cliente) from cliente a where a.lig_cod_' +
        'categoria = c.cod_categoria) as total_cli'
      'from CLIENTE_CATEGORIA c'
      'where c.cod_categoria > 0')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_CATEGORIA: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_CATEGORIA'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
    object cdsConsultaTOTAL_CLI: TIntegerField
      Alignment = taCenter
      FieldName = 'TOTAL_CLI'
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_cliente_categoria,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_CATEGORIA: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_CATEGORIA'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsRegistroSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 5
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '    c.cod_categoria,'
      '    c.descricao,'
      '    c.situacao,'
      '    c.data_cad,'
      '    c.data_alteracao'
      'from CLIENTE_CATEGORIA c'
      'where c.cod_categoria = :codigo')
  end
end
